<?php 

class CepController{	
	public function getCep(){
		// Other examples
		$url = "http://cepapi/rest/cep/get";
		$user = "thyago";
		$password = "7c222fb2927d828af22f592134e8932480637c0d";
		$token = '040215c243d9a611b02e6c6a423e80e6fe59e270';
		
		$chave = array('user' => "thyago", 'password'=>$password, 'token' => $token);
		$result 	= RestClient::get($url,array('cep'=>'38407477', 'token' => $token),$user,$password);
		$endereco 	= json_decode($result->getResponse()); 
		
		if($endereco){
			echo '<pre>';
			print_r($endereco);
		}else{
			echo 'cep não encontrado';
		}
	}
}

?>